/*
 * rank_mgr.h
 *
 *  Created on: Nov 25, 2013
 *      Author: killerg
 */

#ifndef RANK_MGR_H_
#define RANK_MGR_H_

#define NAME_LEN 30

struct rank_player_t {
    int32_t player_combat_force;
    int64_t playerid;
};

struct rank_pet_t {
    string pet_name;
    int32_t serial;
    int32_t protoid;
    int32_t pet_combat_force;
    int64_t owner_id;
};

struct rank_mgr {
    typedef std::vector<rank_player_t> player_rank_list_t;
    typedef std::vector<rank_pet_t> pet_rank_list_t;

    bool init();
    void destroy();
    void update();

    void post_load();

    player_rank_list_t player_list;
    player_rank_list_t player_low_list;
    player_rank_list_t player_mid_list;
    pet_rank_list_t pet_list;
    unordered_map<int64_t, int> player_rank;
    unordered_map<int64_t, int> player_low_rank;
    unordered_map<int64_t, int> player_mid_rank;
    unordered_map<int64_t, int> pet_rank;
    double rank_timer = 0.0f;
};

#endif /* RANK_MGR_H_ */
